#!/bin/sh

wait-until-created /tmp/startupvideo.done
SERIALNUMBER=$(hnvram -qr 1ST_SERIAL_NUMBER)
PLATFORM=$(cat /etc/platform)
FRIENDLYNAME="Google Fiber TV Box"
UITYPE="sage"
if [ -e /config/nickname ]; then
  FRIENDLYNAME="$(cat /config/nickname)"
fi
if is-html-tv-ui; then
  UITYPE="oregano"
fi
/app/client/dialserver -M $PLATFORM -U $SERIALNUMBER -F "$FRIENDLYNAME" -I $UITYPE 2>&1 | logos dialserver &
